package cn.calm.parameter.provider;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.calm.commons.provider.SessionProvider;
import cn.calm.entity.Parameter;
import cn.calm.parameter.service.IParameterService;

public class ParameterProvider implements SessionProvider {
	private IParameterService<Parameter> parameterService;

	@Override
	public Map<String, Object> provider() {
		Parameter para = new Parameter();
		para.setPutSession(1);
		List<Parameter> par = parameterService.list(para);
		Map<String, Object> map = new HashMap<String, Object>();
		for (Parameter p : par) {
			map.put(p.getId(), p.getRealValue());
		}
		return map;
	}

	public void setParameterService(
			IParameterService<Parameter> parameterService) {
		this.parameterService = parameterService;
	}
}
